<xsl:stylesheet version="2.0"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:rcp="http://www.brics.dk/ixwt/recipes">
  <xsl:template match="/">
    <html>
      <head>
        <title>Some exercises of IXWT</title>
      </head>
      <body>
        <h3>Test</h3>
        <p>
          <i>xsl:value-of select="rcp:collection/rcp:description/text()"/:</i><br/>
          <xsl:value-of select="rcp:collection/rcp:description/text()"/>
        </p>
        <h3>Exercise 3.3</h3>
        <p>
          <i>xsl:value-of select="/descendant::rcp:recipe[descendant::rcp:ingredient[attribute::name='milk']]/descendant::rcp:ingredient[attribute::name='eggs']/attribute::amount"/:</i><br/>
          <xsl:value-of select="/descendant::rcp:recipe[descendant::rcp:ingredient[attribute::name='milk']]/descendant::rcp:ingredient[attribute::name='eggs']/attribute::amount"/>
        </p>
        <p>
          <i>xsl:value-of select="sum(//rcp:recipe[//rcp:ingredient[@name='milk']]//rcp:ingredient[@name='eggs']/@amount)"/:</i><br/>
          <xsl:value-of select="sum(//rcp:recipe[//rcp:ingredient[@name='milk']]//rcp:ingredient[@name='eggs']/@amount)"/>
        </p>
        <h3>Exercise 3.4</h3>
        <p>
          <i>xsl:value-of select="sum(//@amount[../@name='eggs'])"/</i><br/>
          <xsl:value-of select="sum(//@amount[../@name='eggs'])"/>
        </p>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>